unit uChassis.local;

interface

uses uDebug.common;

type
  //================================ CHASSIS
  TChassisItem = record
    ChassisID  : integer;
    Name       : string;
    Aero       : integer;
  end;
  TChassisList = class( TObject )
  public
    Items : array of TChassisItem;
    Count : integer;

    constructor Create;
    destructor Destroy; override;

    procedure Add( nChassisID:integer;nName:string;nAero:integer);
    procedure Clear;
  end;

implementation

  //================================ CHASSIS
constructor TChassisList.Create;
begin
  inherited Create;

  Count := 0;
  SetLength( Items, Count );
end;
destructor TChassisList.Destroy;
begin
  Count := 0;
  SetLength( Items, Count );

  inherited Destroy;
end;
procedure TChassisList.Add( nChassisID:integer;nName:string;nAero:integer);
begin
  DevConsole.Msg(ES_DEBUG, 'Adding Chassis '+nName);

  Inc( Count );
  SetLength(Items, Count);

  with Items[ Count-1 ] do
  begin
    ChassisID  := nChassisID;
    Name       := nName;
    Aero       := nAero;
  end;
end;
procedure TChassisList.Clear;
begin
  Count := 0;
  SetLength( Items, Count );
end;

end.
